﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Akso.Infrastructure.Data.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.Entities
{
    /// <summary>
    /// 课程信息表
    /// </summary>
    [Table("Edu_Courses")]
    public class CourseEntity: FullAuditedEntity<Guid>, IMustHaveTenant
    {
        public const int MaxNameLength = 50;
        public const int MaxPeriodLength = 20;
        public const int MaxGradeLength = 50;
        public const int MaxSubjectLength = 50;
        public const int MaxSubjectTypeLength = 50;
        public const int MaxChargeTypeLength = 50;
        public const int MaxCourseTypeLength = 50;
        public const int MaxRemarkLength = 500;
        /// <summary>
        /// 租户ID
        /// </summary>
        public int TenantId { get; set; }
        /// <summary>
        /// 课程名称
        /// </summary>
        [Required]//字段必填
        //[Column("CourseName")]//数据库的字段名，可以与实体字段不同。
        [MaxLength(MaxNameLength)]
        public virtual string CourseName { get; set; }
        /// <summary>
        /// 是否自动生成课程名称
        /// </summary>
        public virtual bool IsAutoCreateName { get; set; }
        /// <summary>
        /// 年份
        /// </summary>
        public virtual int Years { get; set; }
        /// <summary>
        /// 期段
        /// </summary>
        [MaxLength(MaxPeriodLength)]
        public virtual string Period { get; set; }
        public virtual Guid? PeriodGUID { get; set; }
        /// <summary>
        /// 年级
        /// </summary>
        [MaxLength(MaxGradeLength)]
        public virtual string Grade { get; set; }
        public virtual Guid? GradeGUID { get; set; }
        /// <summary>
        /// 科目
        /// </summary>
        [MaxLength(MaxSubjectLength)]
        public virtual string Subject { get; set; }
        public virtual Guid? SubjectGUID { get; set; }
        /// <summary>
        /// 课程科目类型
        /// </summary>
        [MaxLength(MaxSubjectTypeLength)]
        public virtual string SubjectType { get; set; }
        public virtual Guid? SubjectTypeGUID { get; set; }
        /// <summary>
        /// 是否全科课程
        /// </summary>
        public virtual bool IsQK { get; set; }
        /// <summary>
        /// 计费方式
        /// </summary>
        [MaxLength(MaxChargeTypeLength)]
        public virtual string ChargeType { get; set; }
        /// <summary>
        /// 是否按期收费
        /// </summary>
        public virtual bool IsAnQi { get; set; }
        /// <summary>
        /// 收费次数 小时/期 次/期
        /// </summary>
        public virtual int ChargeTime { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        [DecimalPrecision(10, 2)]
        public virtual decimal Price { get; set; }
        /// <summary>
        /// 课程类型(文本)
        /// </summary>
        [MaxLength(MaxCourseTypeLength)]
        public virtual string CourseType { get; set; }
        /// <summary>
        /// 课程类型(值)
        /// </summary>
        public virtual Guid? CourseTypeGuid { get; set; }
        /// <summary>
        /// 是否禁用（状态)
        /// </summary>
        public virtual bool IsDisable { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        [MaxLength(MaxRemarkLength)]
        public virtual string Remark { get; set; }

        public ICollection<CourseScheduleEntity> CourseSchedules { get; set; }
    }
}
